package com.google.code.irouter.servlet;

import java.util.List;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;

import com.google.code.irouter.model.History;
import com.google.code.irouter.model.Model;
import com.google.code.irouter.model.Queue;
import com.google.code.irouter.model.Log;
import com.google.code.irouter.utils.ModelUtil;

public final class Reset extends Service {

	@Override
	protected void execute(ServletConfig servletConfig) throws ServletException {
		List<Model> models = ModelUtil.select(History.class);
		for(Model model : models) {
			ModelUtil.remove(model);
		}
		
		models = ModelUtil.select(Queue.class);
		for(Model model : models) {
			ModelUtil.remove(model);
		}
		
		models = ModelUtil.select(Log.class);
		for(Model model : models) {
			ModelUtil.remove(model);
		}

	}

}
